package com.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @Author 杨冰清
 * @Date 20:45
 * @Description 购物车表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Cart {
    /**
     * 购物车编号
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("id")
    private Integer id;
    /**
     * 商品编号
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("product_id")
    private Integer productId;
    /**
     * 用户编号
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("user_id")
    private Integer userId;
    /**
     * 商品数量
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("quantity")
    private Integer quantity;
    /**
     * 购是否勾选，0代表未勾选，1代表已勾选
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("selected")
    private Integer selected;
    /**
     * 创建时间
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty("create_time")
    private Date createTime;
    /**
     * 购修改时间
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty("update_time")
    private Date updateTime;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    //一个购物车一个用户
    private User user;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Product product;

}
